<?php
require_once '../../core/fcCommon.php';
require_once '../../core/fcORM.php';
require_once '../../log/Logger.php';
Logger::configure('../../log4php.xml');
$logger = Logger::getLogger(__FILE__);

$conn = new Connection();
$res = $conn->find(new Entity("some_table"));
//setlocale(LC_TIME, 'fr_FR');
setlocale(LC_ALL, 'th_TH');
foreach($res as $re){
    $d = new DateTime(date($re->get("update_time")));  
    //$re->put('update_time', $d->format("d M Y H:i:s"));
    $re->put('update_time', Thai::date_format($d, 'วันl ที่ d F พ.ศ. Y H:i:s'));
    //$logger->debug($d->format("d M Y H:i:s")." แบบไทยๆ");
}

$jsonRes = new Map();
$jsonRes->put("identifier", "id");
$jsonRes->put("items", $res);

echo $jsonRes->toJson();
?>
